package AnimalTest;

import java.util.ArrayList;

public class AnimalTest {
    public static void main(String[] args) {
        HassiKi has=new HassiKi("ci",1);
        has.eat();

        LiHua li=new LiHua("ali",3);
        li.eat();

        Tidy ti=new Tidy("handou",2);
        ti.eat();

        BossiCat bos=new BossiCat("boss",4);
        bos.eat();

        ArrayList<Dog> dog=new ArrayList<>();
        dog.add(ti);
        dog.add(has);

        ArrayList<Cat> cat=new ArrayList<>();
        cat.add(li);
        cat.add(bos);

        KeepCat(cat);
        KeepDog(dog);


    }
    public static void KeepCat(ArrayList<? extends Cat> list){
        for (Cat cat : list) {
            System.out.println("养一只"+cat);
        }
    }

    public static void KeepDog(ArrayList<? extends Dog> list){
        for (Dog dog : list) {
            System.out.println("养一只"+dog);
        }
    }
    public static void KeepAnimals(ArrayList<? extends Animal> list){

    }

}
